<template>
  <div class="spec-preview">
      <vue-photo-zoom-pro 
        :high-url="imageListImg || img"
        :out-zoomer="true"  
        :mask="true"
        type="circle"
         mask-color="rgba(255, 255, 255,0)"
        :width="200"
        :height="200"
        >
        <img :src="imageListImg || img" />
      </vue-photo-zoom-pro>
  </div>
</template>

<script>
import vuePhotoZoomPro from 'vue-photo-zoom-pro'
import 'vue-photo-zoom-pro/dist/style/vue-photo-zoom-pro.css'
  export default {
    name: "Zoom",
    data(){
      return{
        imageListImg:""
      }
    },
    props:{
      img:{
        required:true
      }
    },
    components: {
      vuePhotoZoomPro,
    },
    mounted(){
      this.$bus.$on("getimg",(value)=>{
          this.imageListImg = value;
      })
    }
  }
</script>

<style lang="less">
  .spec-preview {
    position: relative;
    width: 400px;
    height: 400px;
    border: 1px solid #ccc;

    img {
      width: 100%;
      height: 100%;
    }

    .zoomer{
      z-index: 5;
      top: 0 !important;
      left: 10px !important;
    }
    

    .selector {
      background-color: rgba(255, 0, 0, 0.327);
    }

    
  }
</style>